import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { OutboundComponent } from './pages/outbound/outbound.component';
import { OutboundDetailComponent } from './pages/outbound-detail/outbound-detail.component';
import { AcceptanceDetailComponent } from './pages/acceptance-detail/acceptance-detail.component';
import { AcceptanceComponent } from './pages/acceptance/acceptance.component';

import { PurcreturnComponent } from './pages/purcreturn/purcreturn.component';
import { PurcreturnDetailComponent } from './pages/purcreturn-detail/purcreturn-detail.component';

import { ReportedlossComponent } from './pages/reportedloss/reportedloss.component';
import { ReportedlossDetailComponent } from './pages/reportedloss-detail/reportedloss-detail.component';
import { TransfersComponent } from './pages/transfers/transfers.component';
import { TransfersDetailComponent } from './pages/transfers-detail/transfers-detail.component';


const routes: Routes = [
    {
        path: 'outbound',
        component: OutboundComponent,
        data: { breadcrumbs: [{ title: '仓库出库' }] },
        children: [
            {
                path: 'detail/:id',
                component: OutboundDetailComponent,
                data: { breadcrumbs: [{ title: '仓库出库', path: '/outbound/outbound' }, { title: '出库详情' }] },
            },
            {
                path: 'detail',
                component: OutboundDetailComponent,
                data: { breadcrumbs: [{ title: '仓库出库', path: '/outbound/outbound' }, { title: '添加出库单' }] },
            },
        ]
    },
    {
        path: 'acceptance',
        component: AcceptanceComponent,
        children: [
            {
                path: 'detail', component: AcceptanceDetailComponent, data: {
                    breadcrumbs: [{ title: '回单验收列表', path: '/outbound/acceptance' }, { title: '添加回单验收' }]
                },
            },
            {
                path: 'detail/:id', component: AcceptanceDetailComponent, data: {
                    breadcrumbs: [{ title: '回单验收列表', path: '/outbound/acceptance' }, { title: '回单验收详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '回单验收列表' }]
        }
    },
    {
        path: 'purcreturn',
        component: PurcreturnComponent,
        children: [
            {
                path: 'detail', component: PurcreturnDetailComponent, data: {
                    breadcrumbs: [{ title: '采购退货列表', path: '/outbound/purcreturn' }, { title: '添加采购退货' }]
                },
            },
            {
                path: 'detail/:id', component: PurcreturnDetailComponent, data: {
                    breadcrumbs: [{ title: '采购退货列表', path: '/outbound/purcreturn' }, { title: '采购退货详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '采购退货列表' }]
        }
    },
    {
        path: 'reportedloss',
        component: ReportedlossComponent,
        children: [
            {
                path: 'detail', component: ReportedlossDetailComponent, data: {
                    breadcrumbs: [{ title: '报损列表', path: '/outbound/reportedloss' }, { title: '添加报损' }]
                },
            },
            {
                path: 'detail/:id', component: ReportedlossDetailComponent, data: {
                    breadcrumbs: [{ title: '报损列表', path: '/outbound/reportedloss' }, { title: '报损详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '报损列表' }]
        }
    },
    {
        path: 'transfers',
        component: TransfersComponent,
        children: [
            {
                path: 'detail', component: TransfersDetailComponent, data: {
                    breadcrumbs: [{ title: '调拨列表', path: '/outbound/transfers' }, { title: '添加调拨' }]
                },
            },
            {
                path: 'detail/:id', component: TransfersDetailComponent, data: {
                    breadcrumbs: [{ title: '调拨列表', path: '/outbound/transfers' }, { title: '调拨详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '调拨列表' }]
        }
    },
];

export const declarationComponents = [OutboundComponent,
    OutboundComponent,
    OutboundDetailComponent,
    AcceptanceComponent,
    AcceptanceComponent,
    PurcreturnComponent,
    PurcreturnDetailComponent,
    AcceptanceDetailComponent,
    ReportedlossDetailComponent,
    ReportedlossComponent,
    TransfersComponent,
    TransfersDetailComponent,
];

export const entryComponents = [
];

@NgModule({
    imports: [
        RouterModule.forChild(routes)
    ],
    exports: [
        RouterModule
    ]
})
export class OutboundRoutingModule { }
